Skip to content

ci(workflows): specify pull_request_target branches#210

Merged
argl merged 1 commit intomainfrom
pull-request-target-branches
Oct 30, 2025
Merged

ci(workflows): specify pull_request_target branches#210
argl merged 1 commit intomainfrom
pull-request-target-branches

Conversation

@caugner
Copy link
Copy Markdown
Contributor

@caugner caugner commented Oct 29, 2025

Description

Update all workflows using pull_request_target to specify trusted target branches, such as main.

Motivation

Security best practice to limit pull_request_target workflows to trusted branches, reducing the attack surface for malicious pull requests.

The pull_request_target trigger causes the workflow to run in the context of the base branch with access to secrets, so it's important:

  • to specify only trusted branches, to avoid that the workflow runs on an untrusted branch,
  • to specify all trusted branches, to avoid that the workflow is skipped on PRs targeting a trusted branch.

Additional details

See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target

Related issues and pull requests

Part of mdn/fred#1021.

@caugner caugner requested review from a team and argl and removed request for a team October 29, 2025 17:20
@caugner caugner marked this pull request as ready for review October 29, 2025 17:31
@caugner caugner requested a review from a team as a code owner October 29, 2025 17:31
@argl argl merged commit 5063f9d into main Oct 30, 2025
4 checks passed
@argl argl deleted the pull-request-target-branches branch October 30, 2025 09:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants